﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using WebChart;
using bi4homev3.Logica;

namespace bi4homev3.Paginas.Reportes
{
    public partial class TestReporte : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CreateChart();
        }

        void CreateChart()
        {
            PieChart chart = new PieChart();
            AccionesReporte med = new AccionesReporte();
            //chart.DataSource = med.Reporte_Serv_Alimentos((string)(Session["usuario"])).Tables[0].DefaultView;
            chart.DataXValueField = "Title";
            chart.DataYValueField = "% de Gasto";
            chart.DataLabels.Visible = true;
            chart.DataLabels.ForeColor = System.Drawing.Color.Blue;
            chart.Shadow.Visible = true;
            chart.DataBind();
            chart.Explosion = 10;
            chart1.Charts.Add(chart);
            chart1.RedrawChart();
        }

        DataSet GetDataSet()
        {
            DataSet ds = new DataSet();
            DataTable table = ds.Tables.Add("My Table");
            table.Columns.Add(new DataColumn("Title"));
            table.Columns.Add(new DataColumn("Price", typeof(int)));

            
                DataRow row = table.NewRow();
                row["Title"] = "Servicios";
                row["Price"] = 67;
                DataRow row1 = table.NewRow();
                row1["Title"] = "Alimentos";
                row1["Price"] = 33;
                table.Rows.Add(row1);
                table.Rows.Add(row);
            return ds;
        }

    }
}
